scoreboard players add zL mt_surf_fill 1

#loop body

scoreboard players operation xP mt_surf_fill = xL mt_surf_fill
scoreboard players operation xP mt_surf_fill += x0 mt_surf_fill
scoreboard players operation yP mt_surf_fill = yL mt_surf_fill
scoreboard players operation yP mt_surf_fill += y0 mt_surf_fill
scoreboard players operation zP mt_surf_fill = zL mt_surf_fill
scoreboard players operation zP mt_surf_fill += z0 mt_surf_fill

execute store result entity @e[limit=1,tag=surf_fill_pos] Pos[0] double 1 run scoreboard players get xP mt_surf_fill
execute store result entity @e[limit=1,tag=surf_fill_pos] Pos[1] double 1 run scoreboard players get yP mt_surf_fill
execute store result entity @e[limit=1,tag=surf_fill_pos] Pos[2] double 1 run scoreboard players get zP mt_surf_fill

# execute at @e[limit=1,tag=surf_fill_pos] run setblock ~ ~ ~ glass
function mountain:surf_fill/judge_surf

execute if score zL mt_surf_fill < z1 mt_surf_fill run function mountain:surf_fill/loop_z